﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Step3_2_5 : CtrlStep
{
    public GameObject jiemian1;
    public GameObject jiemian2;
    public InputField inputField;
    public Button sendBtn;
    
    public GameObject txtGo;
    public Transform parent;
    public string result;

    public Image image1;
    public Image image2;

    public override void Init()
    {
        base.Init();
        jiemian1.SetActive(false);
        jiemian2.SetActive(true);
        image1.color = Color.gray;
        image2.color = Color.white;

        sendBtn.onClick.AddListener(() => {
            isOver = true;
            GameObject go = GameObject.Instantiate<GameObject>(txtGo);
            go.transform.SetParent(parent);
            result = "->接收："+ inputField.text;
            inputField.text = "";
            go.GetComponent<Text>().text = result;

            
        });
    }

    public override void UpdateAction()
    {
        base.UpdateAction();


    }


}
